package com.teemor.blog.service.impl;

import com.teemor.blog.entity.TbTopic;
import com.teemor.blog.entity.condition.TbTopicCondition;
import com.teemor.blog.mapper.TbTopicMapper;
import com.teemor.blog.service.ITopicService;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TopicServiceImpl implements ITopicService {
    @Autowired
    private TbTopicMapper tbTopicMapper;

    public int countTopic(TbTopicCondition condition) {
        return tbTopicMapper.countTopicByCondition(condition);
    }

    public List<TbTopic> qryTopics(TbTopicCondition condition) {
        return tbTopicMapper.selectTopicByCondition(condition);
    }

    public TbTopic qryTopicById(Integer topicId) {
        return tbTopicMapper.selectTopicByTopicId(topicId);
    }

    public int addTopic(TbTopic inParam) {
        return tbTopicMapper.insertTopic(inParam);
    }

    public int updTopicById(TbTopic inParam) {
        return tbTopicMapper.updateTopicByTopicId(inParam);
    }
}